/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FrameDaftarObatAdmin.java
 *
 * Created on 04 Des 13, 0:33:03
 */
package view;

import controller.AdminKontrol;
import java.awt.event.ActionEvent;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import model.Dosis;
import model.EfekSamping;
import model.Indikasi;
import model.KategoriPenyakit;
import model.Kemasan;
import model.Komposisi;
import model.KontraIndikasi;
import model.Obat;
import model.Perhatian;
import model.PunyaDosis;
import model.PunyaEfekSamping;
import model.PunyaIndikasi;
import model.PunyaKemasan;
import model.PunyaKomposisi;
import model.PunyaKontraIndikasi;
import model.PunyaPerhatian;
import tabelmodel.DosisTableModel;
import tabelmodel.DosisTerpilihTableModel;
import tabelmodel.EfekSampingTableModel;
import tabelmodel.EfekSampingTerpilihTableModel;
import tabelmodel.IndikasiTableModel;
import tabelmodel.IndikasiTerpilihTableModel;
import tabelmodel.KemasanTableModel;
import tabelmodel.KemasanTerpilihTableModel;
import tabelmodel.KomposisiTableModel;
import tabelmodel.KomposisiTerpilihTableModel;
import tabelmodel.KontraIndikasiTableModel;
import tabelmodel.KontraIndikasiTableModelTerpilih;
import tabelmodel.ObatTableModel;
import tabelmodel.PerhatianTableModel;
import tabelmodel.PerhatianTableModelTerpilih;

/**
 *
 * @author Asus
 */
public class FrameDaftarObatAdmin extends javax.swing.JFrame {

    /** Creates new form FrameDaftarObatAdmin */
    public FrameDaftarObatAdmin() {
        initComponents();
        tampilKategori();
        tampilKomposisi();
        tampilIndikasi();
        tampilKontraIndikasi();
        tampilPerhatian();
        tampilefek();
        tampilkemasan();
        tampilDosis();
        tampilObat();
        txtDataKodeObat.setEnabled(false);
        idDosis.setEnabled(false);
        idKemasan.setEnabled(false);
        idEfekSamping.setEnabled(false);
        idPerhatian.setEnabled(false);
        idKontraIndikasi.setEnabled(false);
        idIndikasi.setEnabled(false);
        idKomposisi.setEnabled(false);
        namaDosis.setEnabled(false);
        namaKemasan.setEnabled(false);
        namaEfekSamping.setEnabled(false);
        namaPerhatian.setEnabled(false);
        namaKontraIndikasi.setEnabled(false);
        namaIndikasi.setEnabled(false);
        namaKomposisi.setEnabled(false);
        obat1.setEnabled(false);
        obat2.setEnabled(false);
        obat3.setEnabled(false);
        obat4.setEnabled(false);
        obat5.setEnabled(false);
        obat6.setEnabled(false);
        obat7.setEnabled(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDesktopPane1 = new javax.swing.JDesktopPane();
        framePENCARIANADMIN = new javax.swing.JInternalFrame();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        namaObatPencarianAdmin = new javax.swing.JTextField();
        butonCariPencarianAdmin = new javax.swing.JButton();
        butonKembaliPencarianAdmin = new javax.swing.JButton();
        inframePENGISIANDATAOBAT = new javax.swing.JInternalFrame();
        tabPengisianObat = new javax.swing.JTabbedPane();
        tabDataObat = new javax.swing.JPanel();
        jLabel64 = new javax.swing.JLabel();
        jLabel65 = new javax.swing.JLabel();
        jLabel66 = new javax.swing.JLabel();
        comboDataKategoriPenyakit = new javax.swing.JComboBox();
        jLabel67 = new javax.swing.JLabel();
        txtDataKodeObat = new javax.swing.JTextField();
        txtDataNamaObat = new javax.swing.JTextField();
        btnNextDataObat = new javax.swing.JButton();
        tabKomposisi = new javax.swing.JPanel();
        jLabel68 = new javax.swing.JLabel();
        jLabel69 = new javax.swing.JLabel();
        jScrollPane30 = new javax.swing.JScrollPane();
        komposisiterpilih = new javax.swing.JTable();
        jLabel70 = new javax.swing.JLabel();
        btnTambahKomposisi = new javax.swing.JButton();
        btnHapusKomposisi = new javax.swing.JButton();
        btnNextKomposisi = new javax.swing.JButton();
        idKomposisi = new javax.swing.JTextField();
        namaKomposisi = new javax.swing.JTextField();
        jScrollPane41 = new javax.swing.JScrollPane();
        tabelKomposisi = new javax.swing.JTable();
        obat1 = new javax.swing.JTextField();
        btnPrevKomposisi = new javax.swing.JButton();
        tabIndikasi = new javax.swing.JPanel();
        jLabel71 = new javax.swing.JLabel();
        jLabel72 = new javax.swing.JLabel();
        jScrollPane32 = new javax.swing.JScrollPane();
        indikasiterpilih = new javax.swing.JTable();
        jLabel73 = new javax.swing.JLabel();
        btnTambahIndikasi = new javax.swing.JButton();
        btnHapusIndikasi = new javax.swing.JButton();
        btnNextIndikasi = new javax.swing.JButton();
        idIndikasi = new javax.swing.JTextField();
        namaIndikasi = new javax.swing.JTextField();
        jScrollPane42 = new javax.swing.JScrollPane();
        tabelindikasi = new javax.swing.JTable();
        obat2 = new javax.swing.JTextField();
        btnPrevIndikasi = new javax.swing.JButton();
        tabKontraIndikasi = new javax.swing.JPanel();
        jLabel74 = new javax.swing.JLabel();
        jLabel75 = new javax.swing.JLabel();
        jScrollPane34 = new javax.swing.JScrollPane();
        kontraindikasiterpilih = new javax.swing.JTable();
        jLabel76 = new javax.swing.JLabel();
        btnTambahKontraIndikasi = new javax.swing.JButton();
        btnHapusKontraIndikasi = new javax.swing.JButton();
        btnNextKontraIndikasi = new javax.swing.JButton();
        idKontraIndikasi = new javax.swing.JTextField();
        namaKontraIndikasi = new javax.swing.JTextField();
        jScrollPane43 = new javax.swing.JScrollPane();
        tabelkontraindikasi = new javax.swing.JTable();
        obat3 = new javax.swing.JTextField();
        btnPrevKontra = new javax.swing.JButton();
        tabPerhatian = new javax.swing.JPanel();
        jLabel77 = new javax.swing.JLabel();
        jLabel78 = new javax.swing.JLabel();
        jScrollPane36 = new javax.swing.JScrollPane();
        tabelperhatian = new javax.swing.JTable();
        jLabel79 = new javax.swing.JLabel();
        btnTambahPerhatian = new javax.swing.JButton();
        btnHapusPerhatian = new javax.swing.JButton();
        btnNextPerhatian = new javax.swing.JButton();
        idPerhatian = new javax.swing.JTextField();
        namaPerhatian = new javax.swing.JTextField();
        jScrollPane44 = new javax.swing.JScrollPane();
        perhatianterpilih = new javax.swing.JTable();
        obat4 = new javax.swing.JTextField();
        btnPrevPerhatian = new javax.swing.JButton();
        tabEfekSamping = new javax.swing.JPanel();
        jLabel42 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jScrollPane18 = new javax.swing.JScrollPane();
        efeksampingterpilih = new javax.swing.JTable();
        jLabel44 = new javax.swing.JLabel();
        btnTambahEfekSamping = new javax.swing.JButton();
        btnHapusEfeksamping = new javax.swing.JButton();
        btnNextEfeksamping = new javax.swing.JButton();
        idEfekSamping = new javax.swing.JTextField();
        namaEfekSamping = new javax.swing.JTextField();
        jScrollPane19 = new javax.swing.JScrollPane();
        tabelefeksamping = new javax.swing.JTable();
        obat5 = new javax.swing.JTextField();
        btnPrevEfek = new javax.swing.JButton();
        tabKemasan = new javax.swing.JPanel();
        jLabel83 = new javax.swing.JLabel();
        jLabel84 = new javax.swing.JLabel();
        jScrollPane40 = new javax.swing.JScrollPane();
        tabelkemasan = new javax.swing.JTable();
        jLabel85 = new javax.swing.JLabel();
        btnTambahKemasan = new javax.swing.JButton();
        btnNextKemasan = new javax.swing.JButton();
        idKemasan = new javax.swing.JTextField();
        namaKemasan = new javax.swing.JTextField();
        jScrollPane45 = new javax.swing.JScrollPane();
        kemasanterpilih = new javax.swing.JTable();
        obat6 = new javax.swing.JTextField();
        btnPrevKemasan = new javax.swing.JButton();
        btnHapusKemasan = new javax.swing.JButton();
        tabDosis = new javax.swing.JPanel();
        jLabel80 = new javax.swing.JLabel();
        jLabel81 = new javax.swing.JLabel();
        jScrollPane38 = new javax.swing.JScrollPane();
        dosisterpilih = new javax.swing.JTable();
        jLabel82 = new javax.swing.JLabel();
        btnHapusDosis = new javax.swing.JButton();
        idDosis = new javax.swing.JTextField();
        namaDosis = new javax.swing.JTextField();
        jScrollPane39 = new javax.swing.JScrollPane();
        tabeldosis = new javax.swing.JTable();
        obat7 = new javax.swing.JTextField();
        btnPrevDosis = new javax.swing.JButton();
        btnTambahDosis = new javax.swing.JButton();
        btnBatal1 = new javax.swing.JButton();
        btnSELESAI = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tabelOBATADMIN = new javax.swing.JTable();
        btnLogoutADMIN = new javax.swing.JButton();
        btnTambahADMIN = new javax.swing.JButton();
        btnDetailADMIN = new javax.swing.JButton();
        butonHapusADMIN = new javax.swing.JButton();
        btnCariADMIN = new javax.swing.JButton();
        btnBatalADMIN = new javax.swing.JButton();
        detail = new javax.swing.JInternalFrame();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        txtkodeobat = new javax.swing.JTextField();
        txtnamaobat = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        txtkategori = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        komposisi = new javax.swing.JTable();
        jScrollPane3 = new javax.swing.JScrollPane();
        indikasi = new javax.swing.JTable();
        jScrollPane4 = new javax.swing.JScrollPane();
        kontraindikasi = new javax.swing.JTable();
        jScrollPane5 = new javax.swing.JScrollPane();
        perhatian = new javax.swing.JTable();
        jScrollPane6 = new javax.swing.JScrollPane();
        dosis = new javax.swing.JTable();
        jScrollPane7 = new javax.swing.JScrollPane();
        kemasan = new javax.swing.JTable();
        jScrollPane8 = new javax.swing.JScrollPane();
        efeksamping = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        framePENCARIANADMIN.setTitle("Form Pencarian");

        jLabel17.setText("Pencarian Obat");

        jLabel18.setText("Nama Obat");

        butonCariPencarianAdmin.setText("Cari");
        butonCariPencarianAdmin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                butonCariPencarianAdminActionPerformed(evt);
            }
        });

        butonKembaliPencarianAdmin.setText("Kembali");
        butonKembaliPencarianAdmin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                butonKembaliPencarianAdminActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout framePENCARIANADMINLayout = new javax.swing.GroupLayout(framePENCARIANADMIN.getContentPane());
        framePENCARIANADMIN.getContentPane().setLayout(framePENCARIANADMINLayout);
        framePENCARIANADMINLayout.setHorizontalGroup(
            framePENCARIANADMINLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(framePENCARIANADMINLayout.createSequentialGroup()
                .addGap(42, 42, 42)
                .addComponent(jLabel18)
                .addGap(70, 70, 70)
                .addComponent(namaObatPencarianAdmin, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)
                .addContainerGap(82, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, framePENCARIANADMINLayout.createSequentialGroup()
                .addContainerGap(340, Short.MAX_VALUE)
                .addComponent(butonCariPencarianAdmin)
                .addGap(18, 18, 18)
                .addComponent(butonKembaliPencarianAdmin)
                .addGap(64, 64, 64))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, framePENCARIANADMINLayout.createSequentialGroup()
                .addContainerGap(222, Short.MAX_VALUE)
                .addComponent(jLabel17)
                .addGap(246, 246, 246))
        );
        framePENCARIANADMINLayout.setVerticalGroup(
            framePENCARIANADMINLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(framePENCARIANADMINLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel17)
                .addGap(18, 18, 18)
                .addGroup(framePENCARIANADMINLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(namaObatPencarianAdmin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 272, Short.MAX_VALUE)
                .addGroup(framePENCARIANADMINLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(butonKembaliPencarianAdmin)
                    .addComponent(butonCariPencarianAdmin))
                .addGap(25, 25, 25))
        );

        framePENCARIANADMIN.setBounds(0, 0, -1, -1);
        jDesktopPane1.add(framePENCARIANADMIN, javax.swing.JLayeredPane.DEFAULT_LAYER);

        inframePENGISIANDATAOBAT.setTitle("Form Pengisian Data");

        jLabel64.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel64.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel64.setText("DATA OBAT");

        jLabel65.setText("Kode Obat");

        jLabel66.setText("Nama Obat");

        comboDataKategoriPenyakit.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                comboDataKategoriPenyakitMouseClicked(evt);
            }
        });
        comboDataKategoriPenyakit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboDataKategoriPenyakitActionPerformed(evt);
            }
        });

        jLabel67.setText("Kategori Penyakit");

        txtDataKodeObat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtDataKodeObatActionPerformed(evt);
            }
        });

        btnNextDataObat.setText("Selanjutnya");
        btnNextDataObat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNextDataObatActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout tabDataObatLayout = new javax.swing.GroupLayout(tabDataObat);
        tabDataObat.setLayout(tabDataObatLayout);
        tabDataObatLayout.setHorizontalGroup(
            tabDataObatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabDataObatLayout.createSequentialGroup()
                .addGap(47, 47, 47)
                .addGroup(tabDataObatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel67)
                    .addGroup(tabDataObatLayout.createSequentialGroup()
                        .addGroup(tabDataObatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel65)
                            .addComponent(jLabel66))
                        .addGap(108, 108, 108)
                        .addGroup(tabDataObatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtDataKodeObat, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE)
                            .addComponent(comboDataKategoriPenyakit, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtDataNamaObat))))
                .addContainerGap())
            .addComponent(jLabel64, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 673, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabDataObatLayout.createSequentialGroup()
                .addContainerGap(574, Short.MAX_VALUE)
                .addComponent(btnNextDataObat)
                .addContainerGap())
        );
        tabDataObatLayout.setVerticalGroup(
            tabDataObatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabDataObatLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel64, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(34, 34, 34)
                .addGroup(tabDataObatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtDataKodeObat, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel65))
                .addGap(18, 18, 18)
                .addGroup(tabDataObatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel66)
                    .addComponent(txtDataNamaObat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(23, 23, 23)
                .addGroup(tabDataObatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel67)
                    .addComponent(comboDataKategoriPenyakit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 235, Short.MAX_VALUE)
                .addComponent(btnNextDataObat)
                .addContainerGap())
        );

        tabPengisianObat.addTab("Data Obat", tabDataObat);

        jLabel68.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel68.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel68.setText("Komposisi");

        jLabel69.setText("Daftar Komposisi Terpilih Pada Obat ");

        komposisiterpilih.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Komposisi", "Nama Komposisi"
            }
        ));
        komposisiterpilih.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                komposisiterpilihMouseClicked(evt);
            }
        });
        jScrollPane30.setViewportView(komposisiterpilih);

        jLabel70.setText("TABEL KOMPOSISI");

        btnTambahKomposisi.setText("Tambah");
        btnTambahKomposisi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTambahKomposisiActionPerformed(evt);
            }
        });

        btnHapusKomposisi.setText("Hapus");
        btnHapusKomposisi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHapusKomposisiActionPerformed(evt);
            }
        });

        btnNextKomposisi.setText("Selanjutnya");
        btnNextKomposisi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNextKomposisiActionPerformed(evt);
            }
        });

        tabelKomposisi.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Komposisi", "Nama Komposisi"
            }
        ));
        tabelKomposisi.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelKomposisiMouseClicked(evt);
            }
        });
        jScrollPane41.setViewportView(tabelKomposisi);

        btnPrevKomposisi.setText("Sebelumnya");
        btnPrevKomposisi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrevKomposisiActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout tabKomposisiLayout = new javax.swing.GroupLayout(tabKomposisi);
        tabKomposisi.setLayout(tabKomposisiLayout);
        tabKomposisiLayout.setHorizontalGroup(
            tabKomposisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabKomposisiLayout.createSequentialGroup()
                .addGap(168, 168, 168)
                .addComponent(jLabel68, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKomposisiLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(idKomposisi, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKomposisiLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(namaKomposisi, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKomposisiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel69)
                .addGap(26, 26, 26)
                .addComponent(obat1, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKomposisiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane30, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKomposisiLayout.createSequentialGroup()
                .addGap(240, 240, 240)
                .addComponent(btnTambahKomposisi, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(btnHapusKomposisi, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKomposisiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel70))
            .addGroup(tabKomposisiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane41, javax.swing.GroupLayout.PREFERRED_SIZE, 653, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKomposisiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(btnPrevKomposisi)
                .addGap(469, 469, 469)
                .addComponent(btnNextKomposisi))
        );
        tabKomposisiLayout.setVerticalGroup(
            tabKomposisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabKomposisiLayout.createSequentialGroup()
                .addGap(11, 11, 11)
                .addComponent(jLabel68)
                .addGap(2, 2, 2)
                .addComponent(idKomposisi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(namaKomposisi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(20, 20, 20)
                .addGroup(tabKomposisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel69, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(obat1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addComponent(jScrollPane30, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(15, 15, 15)
                .addGroup(tabKomposisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnTambahKomposisi)
                    .addComponent(btnHapusKomposisi))
                .addGap(7, 7, 7)
                .addComponent(jLabel70)
                .addGap(6, 6, 6)
                .addComponent(jScrollPane41, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addGroup(tabKomposisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnPrevKomposisi)
                    .addComponent(btnNextKomposisi)))
        );

        tabPengisianObat.addTab("Komposisi", tabKomposisi);

        jLabel71.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel71.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel71.setText("Indikasi");

        jLabel72.setText("Daftar Indikasi Terpilih Pada Obat");

        indikasiterpilih.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Indikasi", "Nama Indikasi"
            }
        ));
        indikasiterpilih.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                indikasiterpilihMouseClicked(evt);
            }
        });
        jScrollPane32.setViewportView(indikasiterpilih);

        jLabel73.setText("TABEL INDIKASI");

        btnTambahIndikasi.setText("Tambah");
        btnTambahIndikasi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTambahIndikasiActionPerformed(evt);
            }
        });

        btnHapusIndikasi.setText("Hapus");
        btnHapusIndikasi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHapusIndikasiActionPerformed(evt);
            }
        });

        btnNextIndikasi.setText("Selanjutnya");
        btnNextIndikasi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNextIndikasiActionPerformed(evt);
            }
        });

        tabelindikasi.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Indikasi", "Nama Indikasi"
            }
        ));
        tabelindikasi.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelindikasiMouseClicked(evt);
            }
        });
        jScrollPane42.setViewportView(tabelindikasi);

        btnPrevIndikasi.setText("Sebelumnya");
        btnPrevIndikasi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrevIndikasiActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout tabIndikasiLayout = new javax.swing.GroupLayout(tabIndikasi);
        tabIndikasi.setLayout(tabIndikasiLayout);
        tabIndikasiLayout.setHorizontalGroup(
            tabIndikasiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabIndikasiLayout.createSequentialGroup()
                .addGap(170, 170, 170)
                .addComponent(jLabel71, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabIndikasiLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(idIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabIndikasiLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(namaIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabIndikasiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel72)
                .addGap(32, 32, 32)
                .addComponent(obat2, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabIndikasiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane32, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabIndikasiLayout.createSequentialGroup()
                .addGap(240, 240, 240)
                .addComponent(btnTambahIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(btnHapusIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabIndikasiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel73))
            .addGroup(tabIndikasiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane42, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabIndikasiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(btnPrevIndikasi)
                .addGap(469, 469, 469)
                .addComponent(btnNextIndikasi))
        );
        tabIndikasiLayout.setVerticalGroup(
            tabIndikasiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabIndikasiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel71)
                .addGap(3, 3, 3)
                .addComponent(idIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(namaIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(20, 20, 20)
                .addGroup(tabIndikasiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel72, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(obat2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addComponent(jScrollPane32, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(15, 15, 15)
                .addGroup(tabIndikasiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnTambahIndikasi)
                    .addComponent(btnHapusIndikasi))
                .addGap(7, 7, 7)
                .addComponent(jLabel73)
                .addGap(6, 6, 6)
                .addComponent(jScrollPane42, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addGroup(tabIndikasiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnPrevIndikasi)
                    .addComponent(btnNextIndikasi)))
        );

        tabPengisianObat.addTab("Indikasi", tabIndikasi);

        jLabel74.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel74.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel74.setText("Kontra Indikasi");

        jLabel75.setText("Daftar Kontra Indikasi Terpilih Pada Obat");

        kontraindikasiterpilih.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Kontra Indikasi", "Nama Kontra Indikasi"
            }
        ));
        kontraindikasiterpilih.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                kontraindikasiterpilihMouseClicked(evt);
            }
        });
        jScrollPane34.setViewportView(kontraindikasiterpilih);

        jLabel76.setText("TABEL KONTRA INDIKASI");

        btnTambahKontraIndikasi.setText("Tambah");
        btnTambahKontraIndikasi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTambahKontraIndikasiActionPerformed(evt);
            }
        });

        btnHapusKontraIndikasi.setText("Hapus");
        btnHapusKontraIndikasi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHapusKontraIndikasiActionPerformed(evt);
            }
        });

        btnNextKontraIndikasi.setText("Selanjutnya");
        btnNextKontraIndikasi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNextKontraIndikasiActionPerformed(evt);
            }
        });

        tabelkontraindikasi.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Kontra Indikasi", "Nama Kontra Indikasi"
            }
        ));
        tabelkontraindikasi.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelkontraindikasiMouseClicked(evt);
            }
        });
        jScrollPane43.setViewportView(tabelkontraindikasi);

        obat3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                obat3ActionPerformed(evt);
            }
        });

        btnPrevKontra.setText("Sebelumnya");
        btnPrevKontra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrevKontraActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout tabKontraIndikasiLayout = new javax.swing.GroupLayout(tabKontraIndikasi);
        tabKontraIndikasi.setLayout(tabKontraIndikasiLayout);
        tabKontraIndikasiLayout.setHorizontalGroup(
            tabKontraIndikasiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabKontraIndikasiLayout.createSequentialGroup()
                .addGap(162, 162, 162)
                .addComponent(jLabel74, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKontraIndikasiLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(idKontraIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKontraIndikasiLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(namaKontraIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKontraIndikasiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel75)
                .addGap(4, 4, 4)
                .addComponent(obat3, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKontraIndikasiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane34, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKontraIndikasiLayout.createSequentialGroup()
                .addGap(240, 240, 240)
                .addComponent(btnTambahKontraIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(8, 8, 8)
                .addComponent(btnHapusKontraIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKontraIndikasiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel76))
            .addGroup(tabKontraIndikasiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane43, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKontraIndikasiLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(btnPrevKontra)
                .addGap(469, 469, 469)
                .addComponent(btnNextKontraIndikasi))
        );
        tabKontraIndikasiLayout.setVerticalGroup(
            tabKontraIndikasiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabKontraIndikasiLayout.createSequentialGroup()
                .addGap(11, 11, 11)
                .addComponent(jLabel74)
                .addGap(2, 2, 2)
                .addComponent(idKontraIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(namaKontraIndikasi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(20, 20, 20)
                .addGroup(tabKontraIndikasiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel75, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(obat3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addComponent(jScrollPane34, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(15, 15, 15)
                .addGroup(tabKontraIndikasiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnTambahKontraIndikasi)
                    .addComponent(btnHapusKontraIndikasi))
                .addGap(7, 7, 7)
                .addComponent(jLabel76)
                .addGap(6, 6, 6)
                .addComponent(jScrollPane43, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(5, 5, 5)
                .addGroup(tabKontraIndikasiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnPrevKontra)
                    .addComponent(btnNextKontraIndikasi)))
        );

        tabPengisianObat.addTab("Kontra Indikasi", tabKontraIndikasi);

        jLabel77.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel77.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel77.setText("Perhatian");

        jLabel78.setText("Daftar Perhatian Terpilih Pada Obat");

        tabelperhatian.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Perhatian", "Nama Perhatian"
            }
        ));
        tabelperhatian.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelperhatianMouseClicked(evt);
            }
        });
        jScrollPane36.setViewportView(tabelperhatian);

        jLabel79.setText("TABEL PERHATIAN");

        btnTambahPerhatian.setText("Tambah");
        btnTambahPerhatian.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTambahPerhatianActionPerformed(evt);
            }
        });

        btnHapusPerhatian.setText("Hapus");
        btnHapusPerhatian.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHapusPerhatianActionPerformed(evt);
            }
        });

        btnNextPerhatian.setText("Selanjutnya");
        btnNextPerhatian.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNextPerhatianActionPerformed(evt);
            }
        });

        perhatianterpilih.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Perhatian", "Nama Perhatian"
            }
        ));
        perhatianterpilih.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                perhatianterpilihMouseClicked(evt);
            }
        });
        jScrollPane44.setViewportView(perhatianterpilih);

        btnPrevPerhatian.setText("Sebelumnya");
        btnPrevPerhatian.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrevPerhatianActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout tabPerhatianLayout = new javax.swing.GroupLayout(tabPerhatian);
        tabPerhatian.setLayout(tabPerhatianLayout);
        tabPerhatianLayout.setHorizontalGroup(
            tabPerhatianLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabPerhatianLayout.createSequentialGroup()
                .addGap(170, 170, 170)
                .addComponent(jLabel77, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabPerhatianLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(idPerhatian, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabPerhatianLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(namaPerhatian, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabPerhatianLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel78)
                .addGap(29, 29, 29)
                .addComponent(obat4, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabPerhatianLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane44, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabPerhatianLayout.createSequentialGroup()
                .addGap(240, 240, 240)
                .addComponent(btnTambahPerhatian, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(9, 9, 9)
                .addComponent(btnHapusPerhatian, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabPerhatianLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel79))
            .addGroup(tabPerhatianLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane36, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabPerhatianLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(btnPrevPerhatian)
                .addGap(469, 469, 469)
                .addComponent(btnNextPerhatian))
        );
        tabPerhatianLayout.setVerticalGroup(
            tabPerhatianLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabPerhatianLayout.createSequentialGroup()
                .addGap(11, 11, 11)
                .addComponent(jLabel77)
                .addGap(2, 2, 2)
                .addComponent(idPerhatian, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(namaPerhatian, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(20, 20, 20)
                .addGroup(tabPerhatianLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel78, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(obat4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addComponent(jScrollPane44, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(15, 15, 15)
                .addGroup(tabPerhatianLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnTambahPerhatian)
                    .addComponent(btnHapusPerhatian))
                .addGap(7, 7, 7)
                .addComponent(jLabel79)
                .addGap(6, 6, 6)
                .addComponent(jScrollPane36, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(5, 5, 5)
                .addGroup(tabPerhatianLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnPrevPerhatian)
                    .addComponent(btnNextPerhatian)))
        );

        tabPengisianObat.addTab("Perhatian", tabPerhatian);

        jLabel42.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel42.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel42.setText("Efek Samping");

        jLabel43.setText("Daftar Efek Samping Terpilih Pada Obat");

        efeksampingterpilih.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Efek Samping", "Nama Efek Samping"
            }
        ));
        efeksampingterpilih.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                efeksampingterpilihMouseClicked(evt);
            }
        });
        jScrollPane18.setViewportView(efeksampingterpilih);

        jLabel44.setText("TABEL EFEK SAMPING");

        btnTambahEfekSamping.setText("Tambah");
        btnTambahEfekSamping.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTambahEfekSampingActionPerformed(evt);
            }
        });

        btnHapusEfeksamping.setText("Hapus");
        btnHapusEfeksamping.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHapusEfeksampingActionPerformed(evt);
            }
        });

        btnNextEfeksamping.setText("Selanjutnya");
        btnNextEfeksamping.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNextEfeksampingActionPerformed(evt);
            }
        });

        tabelefeksamping.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Efek Samping", "Nama Efek Samping"
            }
        ));
        tabelefeksamping.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelefeksampingMouseClicked(evt);
            }
        });
        jScrollPane19.setViewportView(tabelefeksamping);

        btnPrevEfek.setText("Sebelumnya");
        btnPrevEfek.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrevEfekActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout tabEfekSampingLayout = new javax.swing.GroupLayout(tabEfekSamping);
        tabEfekSamping.setLayout(tabEfekSampingLayout);
        tabEfekSampingLayout.setHorizontalGroup(
            tabEfekSampingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabEfekSampingLayout.createSequentialGroup()
                .addGap(120, 120, 120)
                .addComponent(jLabel42, javax.swing.GroupLayout.PREFERRED_SIZE, 330, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabEfekSampingLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(idEfekSamping, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabEfekSampingLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(namaEfekSamping, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabEfekSampingLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel43)
                .addGap(11, 11, 11)
                .addComponent(obat5, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabEfekSampingLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane18, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabEfekSampingLayout.createSequentialGroup()
                .addGap(240, 240, 240)
                .addComponent(btnTambahEfekSamping, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(btnHapusEfeksamping, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabEfekSampingLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel44))
            .addGroup(tabEfekSampingLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane19, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabEfekSampingLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(btnPrevEfek)
                .addGap(469, 469, 469)
                .addComponent(btnNextEfeksamping))
        );
        tabEfekSampingLayout.setVerticalGroup(
            tabEfekSampingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabEfekSampingLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel42)
                .addGap(3, 3, 3)
                .addComponent(idEfekSamping, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(namaEfekSamping, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(20, 20, 20)
                .addGroup(tabEfekSampingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel43, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(obat5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addComponent(jScrollPane18, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(15, 15, 15)
                .addGroup(tabEfekSampingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnTambahEfekSamping)
                    .addComponent(btnHapusEfeksamping))
                .addGap(7, 7, 7)
                .addComponent(jLabel44)
                .addGap(6, 6, 6)
                .addComponent(jScrollPane19, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(5, 5, 5)
                .addGroup(tabEfekSampingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnPrevEfek)
                    .addComponent(btnNextEfeksamping)))
        );

        tabPengisianObat.addTab("Efek Samping", tabEfekSamping);

        jLabel83.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel83.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel83.setText("Kemasan");

        jLabel84.setText("Daftar Kemasan Terpilih Pada Obat");

        tabelkemasan.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Kemasan", "Nama Kemasan"
            }
        ));
        tabelkemasan.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelkemasanMouseClicked(evt);
            }
        });
        jScrollPane40.setViewportView(tabelkemasan);

        jLabel85.setText("TABEL KEMASAN");

        btnTambahKemasan.setText("Tambah");
        btnTambahKemasan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTambahKemasanActionPerformed(evt);
            }
        });

        btnNextKemasan.setText("Selanjutnya");
        btnNextKemasan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNextKemasanActionPerformed(evt);
            }
        });

        namaKemasan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                namaKemasanActionPerformed(evt);
            }
        });

        kemasanterpilih.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Kemasan", "Nama Kemasan"
            }
        ));
        kemasanterpilih.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                kemasanterpilihMouseClicked(evt);
            }
        });
        jScrollPane45.setViewportView(kemasanterpilih);

        btnPrevKemasan.setText("Sebelumnya");
        btnPrevKemasan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrevKemasanActionPerformed(evt);
            }
        });

        btnHapusKemasan.setText("Hapus");
        btnHapusKemasan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHapusKemasanActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout tabKemasanLayout = new javax.swing.GroupLayout(tabKemasan);
        tabKemasan.setLayout(tabKemasanLayout);
        tabKemasanLayout.setHorizontalGroup(
            tabKemasanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabKemasanLayout.createSequentialGroup()
                .addGap(170, 170, 170)
                .addComponent(jLabel83, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKemasanLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(idKemasan, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKemasanLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(namaKemasan, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKemasanLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel84)
                .addGap(32, 32, 32)
                .addComponent(obat6, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKemasanLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane45, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKemasanLayout.createSequentialGroup()
                .addGap(240, 240, 240)
                .addComponent(btnTambahKemasan, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(btnHapusKemasan, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKemasanLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel85))
            .addGroup(tabKemasanLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane40, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabKemasanLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(btnPrevKemasan)
                .addGap(469, 469, 469)
                .addComponent(btnNextKemasan))
        );
        tabKemasanLayout.setVerticalGroup(
            tabKemasanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabKemasanLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel83)
                .addGap(3, 3, 3)
                .addComponent(idKemasan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(namaKemasan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(20, 20, 20)
                .addGroup(tabKemasanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel84, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(obat6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addComponent(jScrollPane45, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(15, 15, 15)
                .addGroup(tabKemasanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnTambahKemasan)
                    .addComponent(btnHapusKemasan))
                .addGap(7, 7, 7)
                .addComponent(jLabel85)
                .addGap(6, 6, 6)
                .addComponent(jScrollPane40, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(5, 5, 5)
                .addGroup(tabKemasanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnPrevKemasan)
                    .addComponent(btnNextKemasan)))
        );

        tabPengisianObat.addTab("Kemasan", tabKemasan);

        jLabel80.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel80.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel80.setText("Dosis");

        jLabel81.setText("Daftar Dosis Terpilih Pada Obat");

        dosisterpilih.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Dosis", "Nama Dosis"
            }
        ));
        dosisterpilih.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                dosisterpilihMouseClicked(evt);
            }
        });
        jScrollPane38.setViewportView(dosisterpilih);

        jLabel82.setText("TABEL DOSIS");

        btnHapusDosis.setText("Hapus");
        btnHapusDosis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHapusDosisActionPerformed(evt);
            }
        });

        tabeldosis.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Dosis", "Nama Dosis"
            }
        ));
        tabeldosis.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabeldosisMouseClicked(evt);
            }
        });
        jScrollPane39.setViewportView(tabeldosis);

        obat7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                obat7ActionPerformed(evt);
            }
        });

        btnPrevDosis.setText("Sebelumnya");
        btnPrevDosis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrevDosisActionPerformed(evt);
            }
        });

        btnTambahDosis.setText("Tambah");
        btnTambahDosis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTambahDosisActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout tabDosisLayout = new javax.swing.GroupLayout(tabDosis);
        tabDosis.setLayout(tabDosisLayout);
        tabDosisLayout.setHorizontalGroup(
            tabDosisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabDosisLayout.createSequentialGroup()
                .addGap(170, 170, 170)
                .addComponent(jLabel80, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabDosisLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(idDosis, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabDosisLayout.createSequentialGroup()
                .addGap(460, 460, 460)
                .addComponent(namaDosis, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabDosisLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel81)
                .addGap(50, 50, 50)
                .addComponent(obat7, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabDosisLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane38, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabDosisLayout.createSequentialGroup()
                .addGap(240, 240, 240)
                .addComponent(btnTambahDosis, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(btnHapusDosis, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabDosisLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel82))
            .addGroup(tabDosisLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane39, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(tabDosisLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(btnPrevDosis))
        );
        tabDosisLayout.setVerticalGroup(
            tabDosisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabDosisLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel80, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(idDosis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(namaDosis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(20, 20, 20)
                .addGroup(tabDosisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(tabDosisLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jLabel81))
                    .addComponent(obat7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6)
                .addComponent(jScrollPane38, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(15, 15, 15)
                .addGroup(tabDosisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnTambahDosis)
                    .addComponent(btnHapusDosis))
                .addGap(7, 7, 7)
                .addComponent(jLabel82)
                .addGap(6, 6, 6)
                .addComponent(jScrollPane39, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(5, 5, 5)
                .addComponent(btnPrevDosis))
        );

        tabPengisianObat.addTab("Dosis", tabDosis);

        btnBatal1.setText("Batal");
        btnBatal1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBatal1ActionPerformed(evt);
            }
        });

        btnSELESAI.setText("Selesai");
        btnSELESAI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSELESAIActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout inframePENGISIANDATAOBATLayout = new javax.swing.GroupLayout(inframePENGISIANDATAOBAT.getContentPane());
        inframePENGISIANDATAOBAT.getContentPane().setLayout(inframePENGISIANDATAOBATLayout);
        inframePENGISIANDATAOBATLayout.setHorizontalGroup(
            inframePENGISIANDATAOBATLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(inframePENGISIANDATAOBATLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(inframePENGISIANDATAOBATLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(inframePENGISIANDATAOBATLayout.createSequentialGroup()
                        .addGap(241, 241, 241)
                        .addComponent(btnBatal1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnSELESAI, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(tabPengisianObat, javax.swing.GroupLayout.PREFERRED_SIZE, 678, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        inframePENGISIANDATAOBATLayout.setVerticalGroup(
            inframePENGISIANDATAOBATLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, inframePENGISIANDATAOBATLayout.createSequentialGroup()
                .addComponent(tabPengisianObat, javax.swing.GroupLayout.PREFERRED_SIZE, 473, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(inframePENGISIANDATAOBATLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnSELESAI)
                    .addComponent(btnBatal1))
                .addContainerGap(34, Short.MAX_VALUE))
        );

        inframePENGISIANDATAOBAT.setBounds(0, 20, 700, 540);
        jDesktopPane1.add(inframePENGISIANDATAOBAT, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel5.setText("DAFTAR OBAT");

        tabelOBATADMIN.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Kode Obat", "Nama Obat", "Kategori"
            }
        ));
        tabelOBATADMIN.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelOBATADMINMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tabelOBATADMIN);

        btnLogoutADMIN.setText("Logout");
        btnLogoutADMIN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLogoutADMINActionPerformed(evt);
            }
        });

        btnTambahADMIN.setText("Tambah");
        btnTambahADMIN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTambahADMINActionPerformed(evt);
            }
        });

        btnDetailADMIN.setText("Detail");
        btnDetailADMIN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDetailADMINActionPerformed(evt);
            }
        });

        butonHapusADMIN.setText("Hapus");
        butonHapusADMIN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                butonHapusADMINActionPerformed(evt);
            }
        });

        btnCariADMIN.setText("Cari");
        btnCariADMIN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCariADMINActionPerformed(evt);
            }
        });

        btnBatalADMIN.setText("Batal");
        btnBatalADMIN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBatalADMINActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(509, 509, 509)
                .addComponent(btnDetailADMIN)
                .addGap(83, 83, 83)
                .addComponent(btnTambahADMIN)
                .addGap(25, 25, 25)
                .addComponent(butonHapusADMIN)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnCariADMIN)
                .addGap(71, 71, 71)
                .addComponent(btnBatalADMIN)
                .addGap(143, 143, 143))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(220, 220, 220)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addGap(182, 182, 182)
                        .addComponent(btnLogoutADMIN))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 584, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(338, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(67, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnLogoutADMIN)
                    .addComponent(jLabel5))
                .addGap(33, 33, 33)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(64, 64, 64)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnDetailADMIN)
                    .addComponent(btnTambahADMIN)
                    .addComponent(btnBatalADMIN)
                    .addComponent(btnCariADMIN)
                    .addComponent(butonHapusADMIN))
                .addContainerGap(194, Short.MAX_VALUE))
        );

        jPanel1.setBounds(0, 0, 930, 580);
        jDesktopPane1.add(jPanel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel1.setText("Kode Obat");

        jLabel2.setText("Nama Obat");

        txtnamaobat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtnamaobatActionPerformed(evt);
            }
        });

        jLabel3.setText("Kategori");

        txtkategori.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtkategoriActionPerformed(evt);
            }
        });

        jButton1.setText("Keluar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        komposisi.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null},
                {null},
                {null},
                {null}
            },
            new String [] {
                "KOMPOSISI"
            }
        ));
        jScrollPane2.setViewportView(komposisi);

        indikasi.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null},
                {null},
                {null},
                {null}
            },
            new String [] {
                "INDIKASI"
            }
        ));
        jScrollPane3.setViewportView(indikasi);

        kontraindikasi.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null},
                {null},
                {null},
                {null}
            },
            new String [] {
                "KONTRA INDIKASI"
            }
        ));
        jScrollPane4.setViewportView(kontraindikasi);

        perhatian.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null},
                {null},
                {null},
                {null}
            },
            new String [] {
                "PERHATIAN"
            }
        ));
        jScrollPane5.setViewportView(perhatian);

        dosis.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null},
                {null},
                {null},
                {null}
            },
            new String [] {
                "DOSIS"
            }
        ));
        jScrollPane6.setViewportView(dosis);

        kemasan.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null},
                {null},
                {null},
                {null}
            },
            new String [] {
                "KEMASAN"
            }
        ));
        jScrollPane7.setViewportView(kemasan);

        efeksamping.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null},
                {null},
                {null},
                {null}
            },
            new String [] {
                "EFEK SAMPING"
            }
        ));
        jScrollPane8.setViewportView(efeksamping);

        javax.swing.GroupLayout detailLayout = new javax.swing.GroupLayout(detail.getContentPane());
        detail.getContentPane().setLayout(detailLayout);
        detailLayout.setHorizontalGroup(
            detailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, detailLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(detailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, detailLayout.createSequentialGroup()
                        .addGroup(detailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel2)
                            .addComponent(jLabel1))
                        .addGap(83, 83, 83)
                        .addGroup(detailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtkategori)
                            .addComponent(txtnamaobat)
                            .addComponent(txtkodeobat, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)))
                    .addComponent(jButton1)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, detailLayout.createSequentialGroup()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)))
                .addContainerGap())
        );
        detailLayout.setVerticalGroup(
            detailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, detailLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(detailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(txtkodeobat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(detailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(txtnamaobat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(detailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(txtkategori, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(detailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(detailLayout.createSequentialGroup()
                        .addGroup(detailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
                            .addComponent(jScrollPane8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
                            .addComponent(jScrollPane5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
                            .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE))
                        .addGap(60, 60, 60))
                    .addGroup(detailLayout.createSequentialGroup()
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addComponent(jButton1)
                .addGap(104, 104, 104))
        );

        detail.setBounds(0, 0, 930, 510);
        jDesktopPane1.add(detail, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 932, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 581, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void tabelOBATADMINMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelOBATADMINMouseClicked
        // TODO add your handling code here:
        btnTambahADMIN.setText("Update");
        int baris = tabelOBATADMIN.getSelectedRow();
        String kode = tabelOBATADMIN.getValueAt(baris, 0).toString();
        String nama = tabelOBATADMIN.getValueAt(baris, 1).toString();
        String kategori = tabelOBATADMIN.getValueAt(baris, 2).toString();
        txtkodeobat.setText(kode);
        txtnamaobat.setText(nama);
        txtkategori.setText(kategori);
}//GEN-LAST:event_tabelOBATADMINMouseClicked

    private void btnLogoutADMINActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLogoutADMINActionPerformed
        // TODO add your handling code here:
        this.dispose();
//        frameDAFTAROBATADMIN.setVisible(false);
//        frameLOGIN.setVisible(false);
//        radioDOKTER.setSelected(false);
//        radioADMIN.setSelected(false);
//        username.setText("");
//        password.setText("");
//
//        buttonMasukHOME.setEnabled(true);
//        radioADMIN.setEnabled(true);
//        radioDOKTER.setEnabled(true);
//        buttonKeluar.setEnabled(true);
}//GEN-LAST:event_btnLogoutADMINActionPerformed

    private void btnTambahADMINActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTambahADMINActionPerformed
//        // TODO add your handling code here:
        Obat obat = new Obat();
        if (btnTambahADMIN.getText().equalsIgnoreCase("Tambah")) {
            inframePENGISIANDATAOBAT.setVisible(true);
        } else {
            int baris = tabelOBATADMIN.getSelectedRow();
            String kodeObat = tabelOBATADMIN.getValueAt(baris, 0).toString();
            String namaObat = tabelOBATADMIN.getValueAt(baris, 1).toString();
            String kategori = tabelOBATADMIN.getValueAt(baris, 2).toString();
            inframePENGISIANDATAOBAT.setVisible(true);
            txtDataKodeObat.setText(kodeObat);
            txtDataNamaObat.setText(namaObat);
            comboDataKategoriPenyakit.setEnabled(false);
            comboDataKategoriPenyakit.setSelectedItem(kategori);
            txtDataKodeObat.setEditable(false);
            txtDataKodeObat.setText(kodeObat);
            tampilKomposisiTerpilih();
            tampilDosisTerpilih();
            tampilKemasanTerpilih();
            tampilKontraIndikasiTerpilih();
            tampilPerhatianTerpilih();
            tampilindikasiTerpilih();
            tampilefekTerpilih();
        }

    }//GEN-LAST:event_btnTambahADMINActionPerformed

    private void btnDetailADMINActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDetailADMINActionPerformed
//        // TODO add your handling code here:
        tampilKomposisiDetail();
        tampilindikasidetail();
        tampilKontraIndikasiDetail();
        tampilefekDetail();
        tampilPerhatianDetail();
        tampilDosisDetail();
        tampilKemasanDetail();
        detail.setVisible(true);
}//GEN-LAST:event_btnDetailADMINActionPerformed

    private void butonHapusADMINActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butonHapusADMINActionPerformed
        int baris = tabelOBATADMIN.getSelectedRow();
        String kodeObat = tabelOBATADMIN.getValueAt(baris, 0).toString();

        int opsi = JOptionPane.showConfirmDialog(null, "Yakin Hapus ? ", "Konfirmasi", JOptionPane.YES_NO_OPTION);
        if (opsi == JOptionPane.YES_OPTION) {

            Obat obat = new Obat();
            obat.setKodeObat(kodeObat);

            Obat ob = new Obat();
            ob.setKodeObat(kodeObat);
            PunyaDosis pundos = new PunyaDosis();
            pundos.setObat(ob);

            Obat ob1 = new Obat();
            ob1.setKodeObat(kodeObat);
            PunyaEfekSamping pues = new PunyaEfekSamping();
            pues.setObat(ob1);

            Obat ob2 = new Obat();
            ob2.setKodeObat(kodeObat);
            PunyaIndikasi puin = new PunyaIndikasi();
            puin.setObat(ob2);

            Obat ob3 = new Obat();
            ob3.setKodeObat(kodeObat);
            PunyaKemasan pukem = new PunyaKemasan();
            pukem.setObat(ob3);

            Obat ob4 = new Obat();
            ob4.setKodeObat(kodeObat);
            PunyaKomposisi pukom = new PunyaKomposisi();
            pukom.setObat(ob4);

            Obat ob5 = new Obat();
            ob5.setKodeObat(kodeObat);
            PunyaKontraIndikasi pukoin = new PunyaKontraIndikasi();
            pukoin.setObat(ob5);

            Obat ob6 = new Obat();
            ob6.setKodeObat(kodeObat);
            PunyaPerhatian puper = new PunyaPerhatian();
            puper.setObat(ob6);
            try {

                AdminKontrol.getKoneksiKategori().deletePunyaEfekSamping(pues);
                AdminKontrol.getKoneksiKategori().deletePunyaDosis(pundos);
                AdminKontrol.getKoneksiKategori().deletePunyaIndikasi(puin);
                AdminKontrol.getKoneksiKategori().deletePunyaKemasan(pukem);
                AdminKontrol.getKoneksiKategori().deletePunyaKomposisi(pukom);
                AdminKontrol.getKoneksiKategori().deletePunyaKontraIndikasi(pukoin);
                AdminKontrol.getKoneksiKategori().deletePunyaPerhatian(puper);
                AdminKontrol.getKoneksiKategori().deleteObat(obat);

            } catch (SQLException ex) {
                Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
            tampilObat();
        } else {
            tampilObat();
        }
}//GEN-LAST:event_butonHapusADMINActionPerformed

    private void btnCariADMINActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCariADMINActionPerformed
        // TODO add your handling code here:
        framePENCARIANADMIN.setVisible(true);
}//GEN-LAST:event_btnCariADMINActionPerformed

    private void txtDataKodeObatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtDataKodeObatActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_txtDataKodeObatActionPerformed

    private void btnSELESAIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSELESAIActionPerformed

        inframePENGISIANDATAOBAT.setVisible(false);
        namaEfekSamping.setText("");
        namaIndikasi.setText("");
        namaKemasan.setText("");
        namaKomposisi.setText("");
        namaKontraIndikasi.setText("");
        namaObatPencarianAdmin.setText("");
        namaPerhatian.setText("");
        obat1.setText("");
        obat2.setText("");
        obat3.setText("");
        obat4.setText("");
        obat5.setText("");
        obat6.setText("");
        obat7.setText("");
        txtDataKodeObat.setText("");
        txtDataNamaObat.setText("");
        tampilDosisTerpilih();
        tampilKemasanTerpilih();
        tampilKomposisiTerpilih();
        tampilKontraIndikasiTerpilih();
        tampilPerhatianTerpilih();
        tampilefekTerpilih();
        tampilindikasiTerpilih();
        tabPengisianObat.setSelectedIndex(0);
}//GEN-LAST:event_btnSELESAIActionPerformed

    private void butonKembaliPencarianAdminActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butonKembaliPencarianAdminActionPerformed
        // TODO add your handling code here:
//        frameDOKTER.setVisible(true);
        framePENCARIANADMIN.setVisible(false);
        namaObatPencarianAdmin.setText("");

    }//GEN-LAST:event_butonKembaliPencarianAdminActionPerformed

    private void comboDataKategoriPenyakitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboDataKategoriPenyakitActionPerformed
        // TODO add your handling code here:
        try {
            String fix = "";
            String kode = comboDataKategoriPenyakit.getItemAt(comboDataKategoriPenyakit.getSelectedIndex()).toString();
            String kd = kode.substring(0, 3);
            long tmbh = AdminKontrol.getKoneksiKategori().carikodeobat(kd);
            String tmbh1 = String.valueOf(tmbh);
            if (tmbh < 10) {
                String a = "00";
                fix = a + tmbh1;
                String jd = kd + fix;
                txtDataKodeObat.setText(jd);
            } else if (tmbh < 100 && tmbh > 9) {
                String b = "0";
                fix = b + tmbh1;
                String jd = kd + fix;
                txtDataKodeObat.setText(jd);
            } else if (tmbh > 99 && tmbh < 1000) {
                fix = String.valueOf(tmbh);
                String jd = kd + fix;
                txtDataKodeObat.setText(jd);
            } else if (tmbh >= 99) {
            } else {
                JOptionPane.showMessageDialog(this, "JUMLAH OBAT MAKSIMAL TIDAK DAPAT DITAMBAH LAGI!!");
                txtDataKodeObat.setText("");
            }
            //            String jd = kd + fix;
            //            kodebarang.setText(jd);

        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_comboDataKategoriPenyakitActionPerformed

    private void btnNextDataObatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNextDataObatActionPerformed
        // TODO add your handling code here:
        Obat ob = new Obat();
        KategoriPenyakit kat = new KategoriPenyakit();
        AdminKontrol admin;
        String kode = comboDataKategoriPenyakit.getItemAt(comboDataKategoriPenyakit.getSelectedIndex()).toString();
        String kd = kode.substring(0, 3);
        kat.setKodeKategori(kd);
        ob.setKategori(kat);
        ob.setKodeObat(txtDataKodeObat.getText());
        ob.setNamaObat(txtDataNamaObat.getText());
        if (btnTambahADMIN.getText().equalsIgnoreCase("Tambah")) {
            try {
                AdminKontrol.getKoneksiKategori().tambahObat(ob);
                //        home();
            } catch (SQLException ex) {
                Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
        } else {
            try {
                AdminKontrol.getKoneksiKategori().updateObat(ob);
            } catch (SQLException ex) {
                Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        tampilObat();
        obat1.setText(txtDataNamaObat.getText());
        obat2.setText(txtDataNamaObat.getText());
        obat3.setText(txtDataNamaObat.getText());
        obat4.setText(txtDataNamaObat.getText());
        obat5.setText(txtDataNamaObat.getText());
        obat6.setText(txtDataNamaObat.getText());
        obat7.setText(txtDataNamaObat.getText());
        tabPengisianObat.setSelectedIndex(1);
    }//GEN-LAST:event_btnNextDataObatActionPerformed

    private void comboDataKategoriPenyakitMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_comboDataKategoriPenyakitMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_comboDataKategoriPenyakitMouseClicked

    private void komposisiterpilihMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_komposisiterpilihMouseClicked
        // TODO add your handling code here:

        int baris = komposisiterpilih.getSelectedRow();
        String id = komposisiterpilih.getValueAt(baris, 0).toString();
        String nm = komposisiterpilih.getValueAt(baris, 1).toString();
        idKomposisi.setText(id);
        namaKomposisi.setText(nm);

    }//GEN-LAST:event_komposisiterpilihMouseClicked

    private void txtnamaobatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtnamaobatActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtnamaobatActionPerformed

    private void txtkategoriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtkategoriActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtkategoriActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        detail.setVisible(false);
        txtkategori.setText("");
        txtkodeobat.setText("");
        txtnamaobat.setText("");
    }//GEN-LAST:event_jButton1ActionPerformed

    private void btnTambahKomposisiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTambahKomposisiActionPerformed
PunyaKomposisi pkom = new PunyaKomposisi();
        Obat ob = new Obat();
        Komposisi kom = new Komposisi();
        String obat = txtDataKodeObat.getText();
        String komposisi = idKomposisi.getText();
        ob.setKodeObat(obat);
        kom.setIdKomposisi(komposisi);
        pkom.setObat(ob);
        pkom.setKomposisi(kom);
        try {
            int a = AdminKontrol.getKoneksiKategori().cekKomposisi(pkom);
            if (a == 0) {
                try {
                    AdminKontrol.getKoneksiKategori().tambahKomposisi(pkom);
                } catch (SQLException ex) {
                    Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
                }
            }else{
                JOptionPane.showMessageDialog(this, "Tidak bisa menambahkan "
                        + "\ndata yang sama.");
            }
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilKomposisiTerpilih();

    }//GEN-LAST:event_btnTambahKomposisiActionPerformed

    private void tabelKomposisiMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelKomposisiMouseClicked
        // TODO add your handling code here:
        int baris = tabelKomposisi.getSelectedRow();
        String id = tabelKomposisi.getValueAt(baris, 0).toString();
        String nm = tabelKomposisi.getValueAt(baris, 1).toString();
        idKomposisi.setText(id);
        namaKomposisi.setText(nm);
    }//GEN-LAST:event_tabelKomposisiMouseClicked

    private void obat7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_obat7ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_obat7ActionPerformed

    private void indikasiterpilihMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_indikasiterpilihMouseClicked
        // TODO add your handling code here:
        int baris = indikasiterpilih.getSelectedRow();
        String id = indikasiterpilih.getValueAt(baris, 0).toString();
        String nm = indikasiterpilih.getValueAt(baris, 1).toString();
        idIndikasi.setText(id);
        namaIndikasi.setText(nm);
    }//GEN-LAST:event_indikasiterpilihMouseClicked

    private void kontraindikasiterpilihMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_kontraindikasiterpilihMouseClicked
        // TODO add your handling code here:
        int baris = kontraindikasiterpilih.getSelectedRow();
        String id = kontraindikasiterpilih.getValueAt(baris, 0).toString();
        String nm = kontraindikasiterpilih.getValueAt(baris, 1).toString();
        idKontraIndikasi.setText(id);
        namaKontraIndikasi.setText(nm);
    }//GEN-LAST:event_kontraindikasiterpilihMouseClicked

    private void perhatianterpilihMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_perhatianterpilihMouseClicked
        // TODO add your handling code here:
        int baris = perhatianterpilih.getSelectedRow();
        String id = perhatianterpilih.getValueAt(baris, 0).toString();
        String nm = perhatianterpilih.getValueAt(baris, 1).toString();
        idPerhatian.setText(id);
        namaPerhatian.setText(nm);
    }//GEN-LAST:event_perhatianterpilihMouseClicked

    private void efeksampingterpilihMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_efeksampingterpilihMouseClicked
        // TODO add your handling code here:
        int baris = efeksampingterpilih.getSelectedRow();
        String id = efeksampingterpilih.getValueAt(baris, 0).toString();
        String nm = efeksampingterpilih.getValueAt(baris, 1).toString();
        idEfekSamping.setText(id);
        namaEfekSamping.setText(nm);
    }//GEN-LAST:event_efeksampingterpilihMouseClicked

    private void kemasanterpilihMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_kemasanterpilihMouseClicked
        // TODO add your handling code here:
        int baris = kemasanterpilih.getSelectedRow();
        String id = kemasanterpilih.getValueAt(baris, 0).toString();
        String nm = kemasanterpilih.getValueAt(baris, 1).toString();
        idKemasan.setText(id);
        namaKemasan.setText(nm);
    }//GEN-LAST:event_kemasanterpilihMouseClicked

    private void dosisterpilihMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_dosisterpilihMouseClicked
        // TODO add your handling code here:
        int baris = dosisterpilih.getSelectedRow();
        String id = dosisterpilih.getValueAt(baris, 0).toString();
        String nm = dosisterpilih.getValueAt(baris, 1).toString();
        idDosis.setText(id);
        namaDosis.setText(nm);
    }//GEN-LAST:event_dosisterpilihMouseClicked

    private void tabelindikasiMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelindikasiMouseClicked
        // TODO add your handling code here:
        int baris = tabelindikasi.getSelectedRow();
        String id = tabelindikasi.getValueAt(baris, 0).toString();
        String nm = tabelindikasi.getValueAt(baris, 1).toString();
        idIndikasi.setText(id);
        namaIndikasi.setText(nm);
    }//GEN-LAST:event_tabelindikasiMouseClicked

    private void tabelkontraindikasiMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelkontraindikasiMouseClicked
        // TODO add your handling code here:
        int baris = tabelkontraindikasi.getSelectedRow();
        String id = tabelkontraindikasi.getValueAt(baris, 0).toString();
        String nm = tabelkontraindikasi.getValueAt(baris, 1).toString();
        idKontraIndikasi.setText(id);
        namaKontraIndikasi.setText(nm);
    }//GEN-LAST:event_tabelkontraindikasiMouseClicked

    private void tabelperhatianMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelperhatianMouseClicked
        // TODO add your handling code here:
        int baris = tabelperhatian.getSelectedRow();
        String id = tabelperhatian.getValueAt(baris, 0).toString();
        String nm = tabelperhatian.getValueAt(baris, 1).toString();
        idPerhatian.setText(id);
        namaPerhatian.setText(nm);
    }//GEN-LAST:event_tabelperhatianMouseClicked

    private void tabelefeksampingMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelefeksampingMouseClicked
        // TODO add your handling code here:
        int baris = tabelefeksamping.getSelectedRow();
        String id = tabelefeksamping.getValueAt(baris, 0).toString();
        String nm = tabelefeksamping.getValueAt(baris, 1).toString();
        idEfekSamping.setText(id);
        namaEfekSamping.setText(nm);
    }//GEN-LAST:event_tabelefeksampingMouseClicked

    private void tabelkemasanMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelkemasanMouseClicked
        // TODO add your handling code here:
        int baris = tabelkemasan.getSelectedRow();
        String id = tabelkemasan.getValueAt(baris, 0).toString();
        String nm = tabelkemasan.getValueAt(baris, 1).toString();
        idKemasan.setText(id);
        namaKemasan.setText(nm);
    }//GEN-LAST:event_tabelkemasanMouseClicked

    private void tabeldosisMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabeldosisMouseClicked
        // TODO add your handling code here:
        int baris = tabeldosis.getSelectedRow();
        String id = tabeldosis.getValueAt(baris, 0).toString();
        String nm = tabeldosis.getValueAt(baris, 1).toString();
        idDosis.setText(id);
        namaDosis.setText(nm);
    }//GEN-LAST:event_tabeldosisMouseClicked

    private void btnTambahIndikasiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTambahIndikasiActionPerformed
        // TODO add your handling code here:
        PunyaIndikasi pkom = new PunyaIndikasi();
        Obat ob = new Obat();
        Indikasi kom = new Indikasi();
        String obat = txtDataKodeObat.getText();
        String ind = idIndikasi.getText();
        ob.setKodeObat(obat);
        kom.setIdIndikasi(ind);
        pkom.setObat(ob);
        pkom.setIndikasi(kom);
        try {
            int a = AdminKontrol.getKoneksiKategori().cekIndikasi(pkom);
            if (a == 0) {
                try {
                    AdminKontrol.getKoneksiKategori().tambahIndikasi(pkom);
                } catch (SQLException ex) {
                    Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
                }
            }else{
                JOptionPane.showMessageDialog(this, "Tidak bisa menambahkan "
                        + "\ndata yang sama.");
            }
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilindikasiTerpilih();
    }//GEN-LAST:event_btnTambahIndikasiActionPerformed

    private void btnTambahKontraIndikasiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTambahKontraIndikasiActionPerformed
        // TODO add your handling code here:
        PunyaKontraIndikasi pkom = new PunyaKontraIndikasi();
        Obat ob = new Obat();
        KontraIndikasi kom = new KontraIndikasi();
        String obat = txtDataKodeObat.getText();
        String kon = idKontraIndikasi.getText();
        ob.setKodeObat(obat);
        kom.setIdKontraIndikasi(kon);
        pkom.setObat(ob);
        pkom.setKontraIndikasi(kom);
        try {
            int a = AdminKontrol.getKoneksiKategori().cekKontraIndikasi(pkom);
            if (a == 0) {
                try {
                    AdminKontrol.getKoneksiKategori().tambahKontraIndikasi(pkom);
                } catch (SQLException ex) {
                    Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
                }
            }else{
                JOptionPane.showMessageDialog(this, "Tidak bisa menambahkan "
                        + "\ndata yang sama.");
            }
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilKontraIndikasiTerpilih();
    }//GEN-LAST:event_btnTambahKontraIndikasiActionPerformed

    private void btnTambahPerhatianActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTambahPerhatianActionPerformed
        // TODO add your handling code here:
        PunyaPerhatian pkom = new PunyaPerhatian();
        Obat ob = new Obat();
        Perhatian kom = new Perhatian();
        String obat = txtDataKodeObat.getText();
        String per = idPerhatian.getText();
        ob.setKodeObat(obat);
        kom.setIdPerhatian(per);
        pkom.setObat(ob);
        pkom.setPerhatian(kom);
        try {
            int a = AdminKontrol.getKoneksiKategori().cekPerhatian(pkom);
            if (a == 0) {
                try {
                    AdminKontrol.getKoneksiKategori().tambahPerhatian(pkom);
                } catch (SQLException ex) {
                    Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
                }
            }else{
                JOptionPane.showMessageDialog(this, "Tidak bisa menambahkan "
                        + "\ndata yang sama.");
            }
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilPerhatianTerpilih();
    }//GEN-LAST:event_btnTambahPerhatianActionPerformed

    private void btnTambahEfekSampingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTambahEfekSampingActionPerformed
        // TODO add your handling code here:
        PunyaEfekSamping pkom = new PunyaEfekSamping();
        Obat ob = new Obat();
        EfekSamping kom = new EfekSamping();
        String obat = txtDataKodeObat.getText();
        String efe = idEfekSamping.getText();
        ob.setKodeObat(obat);
        kom.setIdEfekSamping(efe);
        pkom.setObat(ob);
        pkom.setEfekSamping(kom);
        try {
            int a = AdminKontrol.getKoneksiKategori().cekEfek(pkom);
            if (a == 0) {
                try {
                    AdminKontrol.getKoneksiKategori().tambahefek(pkom);
                } catch (SQLException ex) {
                    Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
                }
            }else{
                JOptionPane.showMessageDialog(this, "Tidak bisa menambahkan "
                        + "\ndata yang sama.");
            }
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilefekTerpilih();
    }//GEN-LAST:event_btnTambahEfekSampingActionPerformed

    private void btnTambahKemasanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTambahKemasanActionPerformed
        // TODO add your handling code here:
        PunyaKemasan pkom = new PunyaKemasan();
        Obat ob = new Obat();
        Kemasan kom = new Kemasan();
        String obat = txtDataKodeObat.getText();
        String kem = idKemasan.getText();
        ob.setKodeObat(obat);
        kom.setIdKemasan(kem);
        pkom.setObat(ob);
        pkom.setKemasan(kom);
        try {
            int a = AdminKontrol.getKoneksiKategori().cekKemasan(pkom);
            if (a == 0) {
                try {
                    AdminKontrol.getKoneksiKategori().tambahkemasan(pkom);
                } catch (SQLException ex) {
                    Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
                }
            }else{
                JOptionPane.showMessageDialog(this, "Tidak bisa menambahkan "
                        + "\ndata yang sama.");
            }
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilKemasanTerpilih();
    }//GEN-LAST:event_btnTambahKemasanActionPerformed

    private void btnTambahDosisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTambahDosisActionPerformed
        // TODO add your handling code here:
        PunyaDosis pkom = new PunyaDosis();
        Obat ob = new Obat();
        Dosis kom = new Dosis();
        String obat = txtDataKodeObat.getText();
        String dos = idDosis.getText();
        ob.setKodeObat(obat);
        kom.setIdDosis(dos);
        pkom.setObat(ob);
        pkom.setDosis(kom);
        try {
            int a = AdminKontrol.getKoneksiKategori().cekDosis(pkom);
            if (a == 0) {
                try {
                    AdminKontrol.getKoneksiKategori().tambahdosis(pkom);
                } catch (SQLException ex) {
                    Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
                }
            }else{
                JOptionPane.showMessageDialog(this, "Tidak bisa menambahkan "
                        + "\ndata yang sama.");
            }
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilDosisTerpilih();
    }//GEN-LAST:event_btnTambahDosisActionPerformed

    private void btnHapusKomposisiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHapusKomposisiActionPerformed
        // TODO add your handling code here:
        PunyaKomposisi pkom = new PunyaKomposisi();
        Obat ob = new Obat();
        Komposisi kom = new Komposisi();
        String obat = txtDataKodeObat.getText();
        String komposisi = idKomposisi.getText();
        ob.setKodeObat(obat);
        kom.setIdKomposisi(komposisi);
        pkom.setObat(ob);
        pkom.setKomposisi(kom);
        try {
            AdminKontrol.getKoneksiKategori().deleteKomposisi(pkom);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilKomposisiTerpilih();
    }//GEN-LAST:event_btnHapusKomposisiActionPerformed

    private void btnHapusIndikasiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHapusIndikasiActionPerformed
        PunyaIndikasi pkom = new PunyaIndikasi();
        Obat ob = new Obat();
        Indikasi kom = new Indikasi();
        String obat = txtDataKodeObat.getText();
        String ind = idIndikasi.getText();
        ob.setKodeObat(obat);
        kom.setIdIndikasi(ind);
        pkom.setObat(ob);
        pkom.setIndikasi(kom);
        try {
            AdminKontrol.getKoneksiKategori().deleteIndikasi(pkom);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilindikasiTerpilih();        // TODO add your handling code here:
    }//GEN-LAST:event_btnHapusIndikasiActionPerformed

    private void btnHapusKontraIndikasiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHapusKontraIndikasiActionPerformed
        PunyaKontraIndikasi pkom = new PunyaKontraIndikasi();
        Obat ob = new Obat();
        KontraIndikasi kom = new KontraIndikasi();
        String obat = txtDataKodeObat.getText();
        String kon = idKontraIndikasi.getText();
        ob.setKodeObat(obat);
        kom.setIdKontraIndikasi(kon);
        pkom.setObat(ob);
        pkom.setKontraIndikasi(kom);
        try {
            AdminKontrol.getKoneksiKategori().deleteKontraIndikasi(pkom);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilKontraIndikasiTerpilih();        // TODO add your handling code here:
    }//GEN-LAST:event_btnHapusKontraIndikasiActionPerformed

    private void btnHapusPerhatianActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHapusPerhatianActionPerformed
        PunyaPerhatian pkom = new PunyaPerhatian();
        Obat ob = new Obat();
        Perhatian kom = new Perhatian();
        String obat = txtDataKodeObat.getText();
        String per = idPerhatian.getText();
        ob.setKodeObat(obat);
        kom.setIdPerhatian(per);
        pkom.setObat(ob);
        pkom.setPerhatian(kom);
        try {
            AdminKontrol.getKoneksiKategori().deletePerhatian(pkom);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilPerhatianTerpilih();        // TODO add your handling code here:
    }//GEN-LAST:event_btnHapusPerhatianActionPerformed

    private void btnHapusEfeksampingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHapusEfeksampingActionPerformed
        PunyaEfekSamping pkom = new PunyaEfekSamping();
        Obat ob = new Obat();
        EfekSamping kom = new EfekSamping();
        String obat = txtDataKodeObat.getText();
        String efe = idEfekSamping.getText();
        ob.setKodeObat(obat);
        kom.setIdEfekSamping(efe);
        pkom.setObat(ob);
        pkom.setEfekSamping(kom);
        try {
            AdminKontrol.getKoneksiKategori().deleteEfek(pkom);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilefekTerpilih();        // TODO add your handling code here:
    }//GEN-LAST:event_btnHapusEfeksampingActionPerformed

    private void btnHapusKemasanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHapusKemasanActionPerformed
        PunyaKemasan pkom = new PunyaKemasan();
        Obat ob = new Obat();
        Kemasan kom = new Kemasan();
        String obat = txtDataKodeObat.getText();
        String kem = idKemasan.getText();
        ob.setKodeObat(obat);
        kom.setIdKemasan(kem);
        pkom.setObat(ob);
        pkom.setKemasan(kom);
        try {
            AdminKontrol.getKoneksiKategori().deletekemasan(pkom);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilKemasanTerpilih();        // TODO add your handling code here:
    }//GEN-LAST:event_btnHapusKemasanActionPerformed

    private void btnHapusDosisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHapusDosisActionPerformed
        PunyaDosis pkom = new PunyaDosis();
        Obat ob = new Obat();
        Dosis kom = new Dosis();
        String obat = txtDataKodeObat.getText();
        String dos = idDosis.getText();
        ob.setKodeObat(obat);
        kom.setIdDosis(dos);
        pkom.setObat(ob);
        pkom.setDosis(kom);
        try {
            AdminKontrol.getKoneksiKategori().deletedosis(pkom);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        tampilDosisTerpilih();        // TODO add your handling code here:
    }//GEN-LAST:event_btnHapusDosisActionPerformed

    private void btnNextKomposisiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNextKomposisiActionPerformed
        // TODO add your handling code here:
        tabPengisianObat.setSelectedIndex(2);
    }//GEN-LAST:event_btnNextKomposisiActionPerformed

    private void btnNextIndikasiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNextIndikasiActionPerformed
        // TODO add your handling code here:
        tabPengisianObat.setSelectedIndex(3);
    }//GEN-LAST:event_btnNextIndikasiActionPerformed

    private void btnNextKontraIndikasiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNextKontraIndikasiActionPerformed
        tabPengisianObat.setSelectedIndex(4);        // TODO add your handling code here:
    }//GEN-LAST:event_btnNextKontraIndikasiActionPerformed

    private void btnNextPerhatianActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNextPerhatianActionPerformed
        tabPengisianObat.setSelectedIndex(5);        // TODO add your handling code here:
    }//GEN-LAST:event_btnNextPerhatianActionPerformed

    private void btnNextEfeksampingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNextEfeksampingActionPerformed
        tabPengisianObat.setSelectedIndex(6);        // TODO add your handling code here:
    }//GEN-LAST:event_btnNextEfeksampingActionPerformed

    private void btnNextKemasanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNextKemasanActionPerformed
        tabPengisianObat.setSelectedIndex(7);        // TODO add your handling code here:
    }//GEN-LAST:event_btnNextKemasanActionPerformed

    private void btnPrevDosisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrevDosisActionPerformed
        tabPengisianObat.setSelectedIndex(6);       // TODO add your handling code here:
    }//GEN-LAST:event_btnPrevDosisActionPerformed

    private void btnPrevKemasanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrevKemasanActionPerformed
        tabPengisianObat.setSelectedIndex(5);        // TODO add your handling code here:
    }//GEN-LAST:event_btnPrevKemasanActionPerformed

    private void btnPrevEfekActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrevEfekActionPerformed
        tabPengisianObat.setSelectedIndex(4);        // TODO add your handling code here:
    }//GEN-LAST:event_btnPrevEfekActionPerformed

    private void btnPrevPerhatianActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrevPerhatianActionPerformed
        tabPengisianObat.setSelectedIndex(3);        // TODO add your handling code here:
    }//GEN-LAST:event_btnPrevPerhatianActionPerformed

    private void btnPrevKontraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrevKontraActionPerformed
        tabPengisianObat.setSelectedIndex(2);        // TODO add your handling code here:
    }//GEN-LAST:event_btnPrevKontraActionPerformed

    private void btnPrevIndikasiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrevIndikasiActionPerformed
        tabPengisianObat.setSelectedIndex(1);      // TODO add your handling code here:
    }//GEN-LAST:event_btnPrevIndikasiActionPerformed

    private void btnPrevKomposisiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrevKomposisiActionPerformed
        tabPengisianObat.setSelectedIndex(0);        // TODO add your handling code here:
    }//GEN-LAST:event_btnPrevKomposisiActionPerformed

    private void butonCariPencarianAdminActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butonCariPencarianAdminActionPerformed

        tampilCariObat();
        namaObatPencarianAdmin.setText("");
        framePENCARIANADMIN.setVisible(false);
    }//GEN-LAST:event_butonCariPencarianAdminActionPerformed

    private void btnBatalADMINActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBatalADMINActionPerformed
        // TODO add your handling code here:
        tampilObat();
        btnTambahADMIN.setText("Tambah");
    }//GEN-LAST:event_btnBatalADMINActionPerformed

    private void btnBatal1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBatal1ActionPerformed
        String kodeObat = txtDataKodeObat.getText();
        Obat obat = new Obat();
        obat.setKodeObat(kodeObat);

        Obat ob = new Obat();
        ob.setKodeObat(kodeObat);
        PunyaDosis pundos = new PunyaDosis();
        pundos.setObat(ob);

        Obat ob1 = new Obat();
        ob1.setKodeObat(kodeObat);
        PunyaEfekSamping pues = new PunyaEfekSamping();
        pues.setObat(ob1);

        Obat ob2 = new Obat();
        ob2.setKodeObat(kodeObat);
        PunyaIndikasi puin = new PunyaIndikasi();
        puin.setObat(ob2);

        Obat ob3 = new Obat();
        ob3.setKodeObat(kodeObat);
        PunyaKemasan pukem = new PunyaKemasan();
        pukem.setObat(ob3);

        Obat ob4 = new Obat();
        ob4.setKodeObat(kodeObat);
        PunyaKomposisi pukom = new PunyaKomposisi();
        pukom.setObat(ob4);

        Obat ob5 = new Obat();
        ob5.setKodeObat(kodeObat);
        PunyaKontraIndikasi pukoin = new PunyaKontraIndikasi();
        pukoin.setObat(ob5);

        Obat ob6 = new Obat();
        ob6.setKodeObat(kodeObat);
        PunyaPerhatian puper = new PunyaPerhatian();
        puper.setObat(ob6);
        try {

            AdminKontrol.getKoneksiKategori().deletePunyaEfekSamping(pues);
            AdminKontrol.getKoneksiKategori().deletePunyaDosis(pundos);
            AdminKontrol.getKoneksiKategori().deletePunyaIndikasi(puin);
            AdminKontrol.getKoneksiKategori().deletePunyaKemasan(pukem);
            AdminKontrol.getKoneksiKategori().deletePunyaKomposisi(pukom);
            AdminKontrol.getKoneksiKategori().deletePunyaKontraIndikasi(pukoin);
            AdminKontrol.getKoneksiKategori().deletePunyaPerhatian(puper);
            AdminKontrol.getKoneksiKategori().deleteObat(obat);

            
            
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
        inframePENGISIANDATAOBAT.setVisible(false);
        tampilObat();
        // TODO add your handling code here:
    }//GEN-LAST:event_btnBatal1ActionPerformed

    private void obat3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_obat3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_obat3ActionPerformed

    private void namaKemasanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_namaKemasanActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_namaKemasanActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new FrameDaftarObatAdmin().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnBatal1;
    private javax.swing.JButton btnBatalADMIN;
    private javax.swing.JButton btnCariADMIN;
    private javax.swing.JButton btnDetailADMIN;
    private javax.swing.JButton btnHapusDosis;
    private javax.swing.JButton btnHapusEfeksamping;
    private javax.swing.JButton btnHapusIndikasi;
    private javax.swing.JButton btnHapusKemasan;
    private javax.swing.JButton btnHapusKomposisi;
    private javax.swing.JButton btnHapusKontraIndikasi;
    private javax.swing.JButton btnHapusPerhatian;
    private javax.swing.JButton btnLogoutADMIN;
    private javax.swing.JButton btnNextDataObat;
    private javax.swing.JButton btnNextEfeksamping;
    private javax.swing.JButton btnNextIndikasi;
    private javax.swing.JButton btnNextKemasan;
    private javax.swing.JButton btnNextKomposisi;
    private javax.swing.JButton btnNextKontraIndikasi;
    private javax.swing.JButton btnNextPerhatian;
    private javax.swing.JButton btnPrevDosis;
    private javax.swing.JButton btnPrevEfek;
    private javax.swing.JButton btnPrevIndikasi;
    private javax.swing.JButton btnPrevKemasan;
    private javax.swing.JButton btnPrevKomposisi;
    private javax.swing.JButton btnPrevKontra;
    private javax.swing.JButton btnPrevPerhatian;
    private javax.swing.JButton btnSELESAI;
    private javax.swing.JButton btnTambahADMIN;
    private javax.swing.JButton btnTambahDosis;
    private javax.swing.JButton btnTambahEfekSamping;
    private javax.swing.JButton btnTambahIndikasi;
    private javax.swing.JButton btnTambahKemasan;
    private javax.swing.JButton btnTambahKomposisi;
    private javax.swing.JButton btnTambahKontraIndikasi;
    private javax.swing.JButton btnTambahPerhatian;
    private javax.swing.JButton butonCariPencarianAdmin;
    private javax.swing.JButton butonHapusADMIN;
    private javax.swing.JButton butonKembaliPencarianAdmin;
    private javax.swing.JComboBox comboDataKategoriPenyakit;
    private javax.swing.JInternalFrame detail;
    private javax.swing.JTable dosis;
    private javax.swing.JTable dosisterpilih;
    private javax.swing.JTable efeksamping;
    private javax.swing.JTable efeksampingterpilih;
    private javax.swing.JInternalFrame framePENCARIANADMIN;
    private javax.swing.JTextField idDosis;
    private javax.swing.JTextField idEfekSamping;
    private javax.swing.JTextField idIndikasi;
    private javax.swing.JTextField idKemasan;
    private javax.swing.JTextField idKomposisi;
    private javax.swing.JTextField idKontraIndikasi;
    private javax.swing.JTextField idPerhatian;
    private javax.swing.JTable indikasi;
    private javax.swing.JTable indikasiterpilih;
    private javax.swing.JInternalFrame inframePENGISIANDATAOBAT;
    private javax.swing.JButton jButton1;
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel64;
    private javax.swing.JLabel jLabel65;
    private javax.swing.JLabel jLabel66;
    private javax.swing.JLabel jLabel67;
    private javax.swing.JLabel jLabel68;
    private javax.swing.JLabel jLabel69;
    private javax.swing.JLabel jLabel70;
    private javax.swing.JLabel jLabel71;
    private javax.swing.JLabel jLabel72;
    private javax.swing.JLabel jLabel73;
    private javax.swing.JLabel jLabel74;
    private javax.swing.JLabel jLabel75;
    private javax.swing.JLabel jLabel76;
    private javax.swing.JLabel jLabel77;
    private javax.swing.JLabel jLabel78;
    private javax.swing.JLabel jLabel79;
    private javax.swing.JLabel jLabel80;
    private javax.swing.JLabel jLabel81;
    private javax.swing.JLabel jLabel82;
    private javax.swing.JLabel jLabel83;
    private javax.swing.JLabel jLabel84;
    private javax.swing.JLabel jLabel85;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane18;
    private javax.swing.JScrollPane jScrollPane19;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane30;
    private javax.swing.JScrollPane jScrollPane32;
    private javax.swing.JScrollPane jScrollPane34;
    private javax.swing.JScrollPane jScrollPane36;
    private javax.swing.JScrollPane jScrollPane38;
    private javax.swing.JScrollPane jScrollPane39;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane40;
    private javax.swing.JScrollPane jScrollPane41;
    private javax.swing.JScrollPane jScrollPane42;
    private javax.swing.JScrollPane jScrollPane43;
    private javax.swing.JScrollPane jScrollPane44;
    private javax.swing.JScrollPane jScrollPane45;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JTable kemasan;
    private javax.swing.JTable kemasanterpilih;
    private javax.swing.JTable komposisi;
    private javax.swing.JTable komposisiterpilih;
    private javax.swing.JTable kontraindikasi;
    private javax.swing.JTable kontraindikasiterpilih;
    private javax.swing.JTextField namaDosis;
    private javax.swing.JTextField namaEfekSamping;
    private javax.swing.JTextField namaIndikasi;
    private javax.swing.JTextField namaKemasan;
    private javax.swing.JTextField namaKomposisi;
    private javax.swing.JTextField namaKontraIndikasi;
    private javax.swing.JTextField namaObatPencarianAdmin;
    private javax.swing.JTextField namaPerhatian;
    private javax.swing.JTextField obat1;
    private javax.swing.JTextField obat2;
    private javax.swing.JTextField obat3;
    private javax.swing.JTextField obat4;
    private javax.swing.JTextField obat5;
    private javax.swing.JTextField obat6;
    private javax.swing.JTextField obat7;
    private javax.swing.JTable perhatian;
    private javax.swing.JTable perhatianterpilih;
    private javax.swing.JPanel tabDataObat;
    private javax.swing.JPanel tabDosis;
    private javax.swing.JPanel tabEfekSamping;
    private javax.swing.JPanel tabIndikasi;
    private javax.swing.JPanel tabKemasan;
    private javax.swing.JPanel tabKomposisi;
    private javax.swing.JPanel tabKontraIndikasi;
    private javax.swing.JTabbedPane tabPengisianObat;
    private javax.swing.JPanel tabPerhatian;
    private javax.swing.JTable tabelKomposisi;
    private javax.swing.JTable tabelOBATADMIN;
    private javax.swing.JTable tabeldosis;
    private javax.swing.JTable tabelefeksamping;
    private javax.swing.JTable tabelindikasi;
    private javax.swing.JTable tabelkemasan;
    private javax.swing.JTable tabelkontraindikasi;
    private javax.swing.JTable tabelperhatian;
    private javax.swing.JTextField txtDataKodeObat;
    private javax.swing.JTextField txtDataNamaObat;
    private javax.swing.JTextField txtkategori;
    private javax.swing.JTextField txtkodeobat;
    private javax.swing.JTextField txtnamaobat;
    // End of variables declaration//GEN-END:variables

    private void tampilKategori() {
        try {
            comboDataKategoriPenyakit.removeAllItems();
            List<KategoriPenyakit> daftarkategoris = AdminKontrol.getKoneksiKategori().lihatSeluruhKategori();
            for (int i = 0; i < daftarkategoris.size(); i++) {
                KategoriPenyakit kategori = daftarkategoris.get(i);
                comboDataKategoriPenyakit.addItem(kategori.getKodeKategori() + " " + kategori.getNamaKategori());

            }
        } catch (SQLException ex) {
            Logger.getLogger(Applikasi02122013.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilObat() {
        try {
            List<Obat> daftarobat = AdminKontrol.getKoneksiKategori().lihatSeluruhObat();
            ObatTableModel model = new ObatTableModel(daftarobat);
            tabelOBATADMIN.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilCariObat() {
        String x = namaObatPencarianAdmin.getText();

        try {
            List<Obat> daftarobat = AdminKontrol.getKoneksiKategori().cariObat(x);
            ObatTableModel model = new ObatTableModel(daftarobat);
            tabelOBATADMIN.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilKomposisi() {
        try {
            List<Komposisi> daftarkomp = AdminKontrol.getKoneksiKategori().lihatKomposisi();
            KomposisiTableModel model = new KomposisiTableModel(daftarkomp);
            tabelKomposisi.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilKomposisiTerpilih() {
        String a;
        a = txtDataKodeObat.getText();
        try {
            List<Komposisi> daftarkomp = AdminKontrol.getKoneksiKategori().lihatKomposisiTerpilih(a);
            KomposisiTableModel model = new KomposisiTableModel(daftarkomp);
            komposisiterpilih.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilKomposisiDetail() {
        String a;
        a = txtkodeobat.getText();
        try {
            List<Komposisi> daftarkomp = AdminKontrol.getKoneksiKategori().lihatKomposisiTerpilih(a);
            KomposisiTerpilihTableModel model1 = new KomposisiTerpilihTableModel(daftarkomp);
            komposisi.setModel(model1);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilIndikasi() {
        try {
            List<Indikasi> daftarkomp = AdminKontrol.getKoneksiKategori().lihatIndikasi();
            IndikasiTableModel model = new IndikasiTableModel(daftarkomp);
            tabelindikasi.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilindikasiTerpilih() {
        String a;
        a = txtDataKodeObat.getText();

        try {
            List<Indikasi> daftarkomp = AdminKontrol.getKoneksiKategori().lihatIndikasiTerpilih(a);
            IndikasiTableModel model = new IndikasiTableModel(daftarkomp);
            indikasiterpilih.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilindikasidetail() {
        String a;
        a = txtkodeobat.getText();

        try {
            List<Indikasi> daftarkomp = AdminKontrol.getKoneksiKategori().lihatIndikasiTerpilih(a);
            IndikasiTerpilihTableModel model1 = new IndikasiTerpilihTableModel(daftarkomp);
            indikasi.setModel(model1);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilKontraIndikasi() {
        try {
            List<KontraIndikasi> daftarkomp = AdminKontrol.getKoneksiKategori().lihatKontraIndikasi();
            KontraIndikasiTableModel model = new KontraIndikasiTableModel(daftarkomp);
            tabelkontraindikasi.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilKontraIndikasiTerpilih() {
        String a;
        a = txtDataKodeObat.getText();

        try {
            List<KontraIndikasi> daftarkomp = AdminKontrol.getKoneksiKategori().lihatKontraIndikasiTerpilih(a);
            KontraIndikasiTableModel model = new KontraIndikasiTableModel(daftarkomp);
            kontraindikasiterpilih.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilKontraIndikasiDetail() {
        String a;
        a = txtkodeobat.getText();
        try {
            List<KontraIndikasi> daftarkomp = AdminKontrol.getKoneksiKategori().lihatKontraIndikasiTerpilih(a);
            KontraIndikasiTableModelTerpilih model1 = new KontraIndikasiTableModelTerpilih(daftarkomp);
            kontraindikasi.setModel(model1);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilPerhatian() {
        try {
            List<Perhatian> daftarkomp = AdminKontrol.getKoneksiKategori().lihatPerhatian();
            PerhatianTableModel model = new PerhatianTableModel(daftarkomp);
            tabelperhatian.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilPerhatianTerpilih() {
        String a;
        a = txtDataKodeObat.getText();

        try {
            List<Perhatian> daftarkomp = AdminKontrol.getKoneksiKategori().lihatPerhatianTerpilih(a);
            PerhatianTableModel model = new PerhatianTableModel(daftarkomp);
            perhatianterpilih.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilPerhatianDetail() {
        String a;
        a = txtkodeobat.getText();

        try {
            List<Perhatian> daftarkomp = AdminKontrol.getKoneksiKategori().lihatPerhatianTerpilih(a);
            PerhatianTableModelTerpilih model1 = new PerhatianTableModelTerpilih(daftarkomp);
            perhatian.setModel(model1);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilefek() {
        try {
            List<EfekSamping> daftarkomp = AdminKontrol.getKoneksiKategori().lihatEfek();
            EfekSampingTableModel model = new EfekSampingTableModel(daftarkomp);
            tabelefeksamping.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilefekTerpilih() {
        String a;
        a = txtDataKodeObat.getText();

        try {
            List<EfekSamping> daftarkomp = AdminKontrol.getKoneksiKategori().lihatEfekTerpilih(a);
            EfekSampingTableModel model = new EfekSampingTableModel(daftarkomp);
            efeksampingterpilih.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilefekDetail() {
        String a;
        a = txtkodeobat.getText();

        try {
            List<EfekSamping> daftarkomp = AdminKontrol.getKoneksiKategori().lihatEfekTerpilih(a);
            EfekSampingTerpilihTableModel model1 = new EfekSampingTerpilihTableModel(daftarkomp);
            efeksamping.setModel(model1);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilkemasan() {
        try {
            List<Kemasan> daftarkomp = AdminKontrol.getKoneksiKategori().lihatKemasan();
            KemasanTableModel model = new KemasanTableModel(daftarkomp);
            tabelkemasan.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilKemasanTerpilih() {
        String a;
        a = txtDataKodeObat.getText();

        try {
            List<Kemasan> daftarkomp = AdminKontrol.getKoneksiKategori().lihatKemasanTerpilih(a);
            KemasanTableModel model = new KemasanTableModel(daftarkomp);
            kemasanterpilih.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilKemasanDetail() {
        String a;
        a = txtkodeobat.getText();

        try {
            List<Kemasan> daftarkomp = AdminKontrol.getKoneksiKategori().lihatKemasanTerpilih(a);
            KemasanTerpilihTableModel model1 = new KemasanTerpilihTableModel(daftarkomp);
            kemasan.setModel(model1);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilDosis() {
        try {
            List<Dosis> daftarkomp = AdminKontrol.getKoneksiKategori().lihatDosis();
            DosisTableModel model = new DosisTableModel(daftarkomp);
            tabeldosis.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilDosisTerpilih() {
        String a;
        a = txtDataKodeObat.getText();

        try {
            List<Dosis> daftarkomp = AdminKontrol.getKoneksiKategori().lihatDosisTerpilih(a);
            DosisTableModel model = new DosisTableModel(daftarkomp);
            dosisterpilih.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilDosisDetail() {
        String a;
        a = txtkodeobat.getText();

        try {
            List<Dosis> daftarkomp = AdminKontrol.getKoneksiKategori().lihatDosisTerpilih(a);
            DosisTerpilihTableModel model1 = new DosisTerpilihTableModel(daftarkomp);
            dosis.setModel(model1);
        } catch (SQLException ex) {
            Logger.getLogger(FrameDaftarObatAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
